package com.zzgele.qmzb.api.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.zzgele.qmzb.api.core.AbstractService;
import com.zzgele.qmzb.api.dao.VideoListMapper;
import com.zzgele.qmzb.api.model.VideoList;
import com.zzgele.qmzb.api.service.VideoListService;
import com.zzgele.qmzb.api.utils.PageUtil;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service(interfaceClass = VideoListService.class,proxy="jdk")
@Component
@Transactional
public class VideoListServiceImpl extends AbstractService<VideoList> implements VideoListService {
    @Resource
    private VideoListMapper videoListMapper;

    public  int deleteVideo(Map<String, Object> map){
        return videoListMapper.deleteVideo(map);
    }

    public List<HashMap> recomendList(Map<String, Object> map){
        return videoListMapper.recomendList(map);
    }
    //我发布的
    public List<HashMap> myList(Map<String, Object> map){
        return videoListMapper.myList(map);
    }

    public List<HashMap> recommandList(Map<String, Object> map){
        return videoListMapper.recommandList(map);

    }

    public List<HashMap> getListVideo(Map<String, Object> map, Integer page, Integer page_size) {
        if(page==null)
            page=1;
        if(page_size==null){
            page_size=20;
        }
        PageUtil.startPage(page, page_size);
        return videoListMapper.getList(map);
    }

}
